
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>{{$title}}</title>

    <link href="{{URL::asset('/inspinia/css/bootstrap.min.css')}}" rel="stylesheet">
    <script src="{{URL::asset('/inspinia/js/jquery-2.1.1.js')}}"></script>
    <script src="{{URL::asset('/inspinia/js/bootstrap.min.js')}}"></script>

    <link href="{{URL::asset('/inspinia/css/animate.css')}}" rel="stylesheet">
    <link href="{{URL::asset('/inspinia/css/style.css')}}" rel="stylesheet">
    <style>
        * {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
        }
        *:before,
        *:after {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
        }
    </style>
</head>

<body class="gray-bg">

{{--<div class="lock-word animated fadeInDown">--}}
    {{--<span class="first-word">LOCKED</span><span>SCREEN</span>--}}
{{--</div>--}}
<div class="middle-box text-center lockscreen animated fadeInDown">
    <div class="from layui-form">

        <div class="m-b-md">
            <img alt="image" class="img-circle circle-border" style="max-width: 200px;max-height: 200px;" src="{{$userData['admin_user_headimg']}}">
        </div>
        <h3>{{$userData['admin_user_name']}}</h3>
        <p>你屏幕已锁定,你需要输入密码解开</p>

            <div class="form-group">
                <input type="password" lay-verify="required" lay-vertype="tips"  name="password" id="form-field-1" class="form-control" placeholder="******" required="">
            </div>
            <input id="_token" type="hidden" name="_token" value="{{csrf_token()}}"/>
            <button lay-submit lay-filter="*" type="button" class="btn btn-primary block full-width" id="send">Unlock</button>
    </div>
</div>

<script src="{{URL::asset('/Lib/layui/layui.js')}}"></script>
</body>

</html>
<script>
    $(function(){
        layui.use('form', function(){
            var form = layui.form;
            form.on('submit(*)', function(data){
                var $this = $(data.elem);
                $this.attr('disabled', 'disabled');

                $.ajax({
                    url: '{{URL::route('admin_lockscreen')}}',// 跳转到 action
                    data: data.field,
                    type: 'post',
                    cache: false,
                    dataType: 'json',
                    success: function (data) {
                        if (data['status'] == 1) {
                            location.replace('{{URL::route('admin_index')}}');
                        } else {
                            layer.msg(data['msg'], {icon: 2});
                        }
                        $this.attr('disabled', false);
                    },
                    error: function () {
                        $this.attr('disabled', false);
                    }
                });
                return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
            });
        });

    });
    $(".from").bind("keydown",function(e){
        // 兼容FF和IE和Opera
        var theEvent = e || window.event;
        var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
        if (code == 13) {
            //回车执行查询
            $(".full-width").click();
        }
    });

</script>